﻿<Application x:Class="AspNetMembershipManager.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             ShutdownMode="OnExplicitShutdown"
             Startup="Application_Startup"
             Exit="Application_Exit">
    <Application.Resources>
		<Style TargetType="{x:Type GroupBox}">
			<Setter Property="Padding" Value="5" />
		</Style>
		<Style TargetType="{x:Type Label}">
			<Setter Property="Margin" Value="5,0,5,0" />
			<Setter Property="HorizontalAlignment" Value="Left" />
		</Style>
		<Style TargetType="{x:Type TextBox}">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="Margin" Value="0,2,40,2" />
			<Setter Property="Validation.ErrorTemplate">
				<Setter.Value>
					<ControlTemplate>
						<DockPanel LastChildFill="true">
							<Border Background="OrangeRed" DockPanel.Dock="right" Margin="5,0,0,0" 
                                Width="20" Height="20" CornerRadius="5"
                                ToolTip="{Binding ElementName=customAdorner, 
                                          Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
								<TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" 
                                   FontWeight="Bold" Foreground="white" />
							</Border>
							<AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
								<Border BorderBrush="red" BorderThickness="1" />
							</AdornedElementPlaceholder>
						</DockPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="noValidationTextBox" TargetType="{x:Type TextBox}">
			<Setter Property="VerticalAlignment" Value="Center" />
		</Style>
		<Style TargetType="{x:Type PasswordBox}">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="Margin" Value="0,2,40,2" />
			<Setter Property="Validation.ErrorTemplate">
				<Setter.Value>
					<ControlTemplate>
						<DockPanel LastChildFill="true">
							<Border Background="OrangeRed" DockPanel.Dock="right" Margin="5,0,0,0" 
                                Width="20" Height="20" CornerRadius="5"
                                ToolTip="{Binding ElementName=customAdorner, 
                                          Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
								<TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" 
                                   FontWeight="Bold" Foreground="white" />
							</Border>
							<AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
								<Border BorderBrush="red" BorderThickness="1" />
							</AdornedElementPlaceholder>
						</DockPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ErrorMessage" TargetType="{x:Type Label}">
			<Setter Property="Foreground" Value="Red" />
		</Style>
	</Application.Resources>
</Application>
